// EcoModeler - C# Edition :: Version 9.16 build 3301
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using Eco.Services;
using Eco.ObjectRepresentation;
using Eco.ObjectImplementation;
using Eco.UmlRt;
using Eco.UmlCodeAttributes;
using Eco.Subscription;

namespace TTServer
{
	#region MM_ECO_Generated
	#region Attributes
	[UmlElement(Id="{f036c221-0657-4a71-87e1-227825aafccb}")]
	#endregion

	#endregion
	public class Aufstellung: object, ILoopBack
	{
		#region MM_ECO AutoGenerated ECO code

		protected IContent eco_Content;

		IObject IObjectProvider.AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public IObjectInstance AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public struct Eco_LoopbackIndices
		{
			public const int Eco_FirstMember = 0;
			public const int Eco_MemberCount = (Eco_FirstMember + 6);
			public const int AufgestellerSpieler_MemberIndex = Eco_FirstMember + 0;
			public const int AufgestelltesDoppel_MemberIndex = Eco_FirstMember + 1;
			public const int Heim_MemberIndex = Eco_FirstMember + 2;
			public const int Mannschaft_MemberIndex = Eco_FirstMember + 3;
			public const int Meldebogenspieler_MemberIndex = Eco_FirstMember + 4;
			public const int Spiel_MemberIndex = Eco_FirstMember + 5;
		}

		public virtual object get_MemberByIndex(int index)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		public virtual void set_MemberByIndex(int index, object value)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		protected void Initialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content == null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				this.eco_Content = factory.CreateContent(this);
				this.eco_Content.LoopbackValid();
			}
		}

		protected void Deinitialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content != null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				factory.CreateContentFailed(this.eco_Content, this);
				this.eco_Content = null;
			}
		}
		#endregion

		#region MM_ECO Model owned attributes
		//Note: Do not remove any property within this region, nor change its signature



		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Aufstellung.Eco_LoopbackIndices.Mannschaft_MemberIndex), Id="{780c61e2-bc66-45dd-8dbc-e987dad79553}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.AufstellungMannschaft), Index=1)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Mannschaft Mannschaft
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Mannschaft) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Mannschaft_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Mannschaft_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Aufstellung.Eco_LoopbackIndices.Meldebogenspieler_MemberIndex), Id="{d652dbef-db81-49d2-a141-f22cb8080104}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.Einzelposition), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		[UmlTaggedValue("Eco.Ordered", "True")]
		#endregion
		public IEcoList<Meldebogenspieler> Meldebogenspieler
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Meldebogenspieler>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Meldebogenspieler_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Aufstellung.Eco_LoopbackIndices.Spiel_MemberIndex), Id="{237ab97e-90da-4934-b96c-de8f4fc3cb1c}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SpielAufstellung), Index=0)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Spiel Spiel
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Spiel) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Spiel_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Spiel_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Aufstellung.Eco_LoopbackIndices.AufgestellerSpieler_MemberIndex), Id="{a07cd85a-1626-48fd-830c-62376dd5e72f}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.AufstellungAufgestellerSpieler), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		[UmlTaggedValue("Eco.Ordered", "True")]
		#endregion
		public IEcoList<AufgestelltesEinzel> AufgestellerSpieler
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<AufgestelltesEinzel>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.AufgestellerSpieler_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Aufstellung.Eco_LoopbackIndices.AufgestelltesDoppel_MemberIndex), Id="{7bcc249a-eafe-4144-baa0-013c06fe7a34}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.AufstellungAufgestelltesDoppel), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		[UmlTaggedValue("Eco.Ordered", "True")]
		#endregion
		public IEcoList<AufgestelltesDoppel> AufgestelltesDoppel
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<AufgestelltesDoppel>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.AufgestelltesDoppel_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Aufstellung.Eco_LoopbackIndices.Heim_MemberIndex), Id="{29e279c3-ce14-428e-8a4f-5eddaf122da8}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Heimmannschaft?
		/// Heimmannschaft?
		#endregion

		#endregion
		public bool Heim
		{
			get
			{
				#region MM_ECO_Generated
				return (bool) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Heim_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Heim_MemberIndex, ((object)(value)));
				#endregion
			}
		}
		#endregion

		#region MM_ECO Model owned methods
		//Note: Do not remove any method within this region, nor change its signature

		public Aufstellung(IContent content)
		{
			#region MM_ECO_Generated
			this.eco_Content = content;
			content.AssertLoopbackUnassigned();
			#endregion
		}

		public Aufstellung(IEcoServiceProvider serviceProvider)
		{
			this.Initialize(serviceProvider);
			try
			{
				// Place user code ONLY here
			}
			catch (System.Exception)
			{
				this.Deinitialize(serviceProvider);
				throw;
			}
		}
		#endregion
	}
}
